import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import AboutView from '../views/AboutView.vue'
import AddVideo from '../views/AddVideo.vue'
import Description from '../views/Description.vue'
import PlayVideo from '../views/PlayVideo.vue'
import Layout from '@/layout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '',
        component: HomeView,
        name: 'home'
      }
    ]
  },
  {
    path: '/about',
    component: Layout,
    children: [
      {
        path: '',
        component: AboutView
      }
    ]
  },
  {
    path: '/description',
    component: Layout,
    children: [
      {
        path: '',
        component: Description
      }
    ]
  },
  {
    path: '/video',
    component: Layout,
    children: [
      {
        path: '',
        component: AddVideo
      }
    ]
  },
  {
    path: '/play',
    component: Layout,
    children: [
      {
        path: '',
        component: PlayVideo
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
